pdf: eleven settings - orientation, mixed paper, rotate, header version and the document properties - #153
Merged
Conversation
…on and the document properties orientation lays pages upright, wide or both in turn. page_size=mixed walks a4, letter, legal, a3, a5, one a page, taken from the page number rather than the seed. rotate writes /Rotate and leaves the page upright. pdf_version writes 1.4 or 1.7. title, author, subject, keywords, creator, producer, created and modified fill the information dictionary: printable ASCII between brackets as before, anything else as UTF-16 with a byte order mark, dates checked against the calendar and written in the zone asked for, never the machine's. Mixed pages in a one page document are refused rather than written uniform. Defaults write exactly the old bytes: compared against the previous binary on 300 requests, and pinned by the golden value. Two new golden cases pin the settings when set. A setting may name a block it belongs to (format.Property.Group). The window draws the name with the existing Subheading, tfg formats prints it, the JSON carries it, and Register refuses a block declared in two places. An empty free text box without a default says "not set" instead of "worked out from the size", which was untrue for the archive password too. New guards: pdfinfo reads every setting back, with a file that must report no author as the negative control. The seed sweep of the minimum now runs under every non-default choice of every format, not only the defaults - a deliberately seed dependent landscape page was red there and green in the old guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 5 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (27)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…the choice sweep CI: 50 functions nested three deep against a cap of 49 - pdfString held a loop in a branch in a loop. The printable check and the UTF-16 writer are their own functions now. And the exhaustive linter wanted every PropertyKind named in the sweep's switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eleven new PDF settings, and the first format with enough of them to need blocks.
Pages:
orientation(portrait, landscape, mixed),page_size=mixed(a4, letter, legal, a3, a5, one a page),rotate(0, 90, 180, 270 - writes/Rotateand leaves the page upright, so a reader that ignores it shows something different from one that follows it),pdf_version(1.4, 1.7).Document properties:
title,author,subject,keywords,creator,producer,created,modified. Printable ASCII is written between brackets as before, anything else as UTF-16 with a byte order mark, so Polish letters and line breaks read back unchanged. Dates take2024-02-29,2024-02-29T13:45:00or2024-02-29T13:45:00+02:00, are checked against the calendar, are written in the zone asked for and never in the machine's, andnoneleaves a date out. Mixed pages in a one page document are refused rather than written uniform.Bytes: a file made without these settings is the file the previous version made - compared against the previous binary on 300 requests (five paper sizes, 1, 2 and 24 pages, label on and off, two seeds, five sizes from below the floor to 64 KB, refusals included) and pinned by
pdf_16kib. Two new golden cases pin the settings when set.Blocks of settings:
format.Property.Group. The window draws the name with the existingSubheading,tfg formatsprints it in the same place, the JSON carries it, andRegisterrefuses a block declared in two places. New stored screen:generate-pdf-settings.Empty text box: a free text setting with no default says "not set" instead of "worked out from the size", which was untrue for the archive password as well.
Guards
TestEveryPdfSettingSurvivesItsReferenceTool-pdfinforeads every setting back (fields, dates, size and turn of each page, header version), and the file with nothing set must report no author, subject, keywords, creator or modification date. Named for the reference tool job, which installs poppler.TestTheMinimumStandsWhateverTheSeedIsUnderEveryDeclaredChoice- the 256 seed sweep of the minimum under every non-default choice of every format. The existing sweep runs at defaults only: a deliberately seed dependent landscape page was red here and green there.TestASettingsBlockIsNamedWhereItStartsOnBothOutputs,TestABlockOfSettingsDeclaredInTwoPlacesIsRefused.Out of this change on purpose: compression (it makes the length depend on the seed and needs its own design), PDF 2.0 (it needs a file identifier and the widths of the font's characters), and the text that runs past the right edge of an A5 page, which will be fixed together with 2.0.
🤖 Generated with Claude Code